
     <!--- 编辑模态框 -->
    <div class="row" style="overflow:hidden;" id="Modals-edit" style="display: none;">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">编辑管理员&emsp;ID：{$arr['id']}</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">

                    <form class="am-form tpl-form-border-form tpl-form-border-br" id="Modals-form">
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">帐号 <span
                                    class="tpl-form-line-small-title">Name</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" class="tpl-form-input" id="user-name"
                                       name="name" value="{$arr['name']}">
                                <small>建议3个字符以上。</small>
                            </div>
                        </div>


                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">密码 <span
                                    class="tpl-form-line-small-title">Pass</span></label>
                            <div class="am-u-sm-9">
                                <input type="password" placeholder="为空则不更改" name="pass">
                            </div>
                        </div>

                        <div class="am-form-group">
                        <label for="user-phone" class="am-u-sm-3 am-form-label">角色 
                            <span class="tpl-form-line-small-title">Role</span>
                        </label>
                        {volist name="data" id="v"}
                        <label class="am-radio-inline">
                            <input type="radio" name="role" value="{$v['id']}" data-am-ucheck {:$v['id']==$rid?'checked="checked"':''}> {$v['role']}
                        </label>
                        {/volist}
                    </div>
                        <input type="hidden" name="role_ls" value="{$rid}">

                        <div class="am-form-group">
                            <label for="user-intro" class="am-u-sm-3 am-form-label">激活/禁用</label>
                            <div class="am-u-sm-9">
                                <div class="tpl-switch">
                                    <input type="checkbox" class="ios-switch bigswitch tpl-switch-btn" name="status"
                                           {:$arr['status']==1?'checked':''}>
                                    <div class="tpl-switch-btn-view">
                                        <div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>

                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success "
                                        id="admin-edit-submit" url="{:url('admin/admin/update','id='.$arr['id'])}">提交
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

<script>

    $(function(){
        
        //提交编辑操作
        $('#admin-edit-submit').click(function () {
            var info = $('#Modals-form').serialize();
            console.log($('#admin-add-submit').attr('url'));

            $.ajax({
                type: 'put',
                data: info,
                url: $('#admin-edit-submit').attr('url'),
                success: function (data) {
                        // alert(data);
                        if(confirm(data+'\n点击【确定】将刷新页面\n点击【取消】可继续修改')){
                            location = location;
                        }
                },
                error: function () {
                    alert('执行失败，请重试');
                }
            });
        });
        
    });

</script>